<?php
include '../business/dao/BaseDataAccess.php';
$baseDao = new BaseDao();
$baseDao->getConnect();
mysql_query("drop table news");
mysql_query("drop table product");
mysql_query("drop table resource");
mysql_query("drop table product_resource");
$rs = mysql_query("create table news (id int not null primary key auto_increment,title varchar(200),publish_date datetime,update_date datetime,author varchar(100),content blob,count int,reference varchar(100),next_id int,prev_id int) default charset=utf8");
echo $rs;
$rs = mysql_query("create table product (id int not null primary key auto_increment,thumbnail_id int,name varchar(50),catalog varchar(50),publish_date datetime,update_date datetime,content blob,count int) default charset=utf8");
echo $rs;
$rs = mysql_query("create table resource (id int not null primary key auto_increment,type varchar(10),data longblob,file_name varchar(50),file_size varchar(50),file_type varchar(50),update_date datetime) default charset=utf8");
echo $rs;
$rs = mysql_query("create table product_resource (id int not null primary key auto_increment,product_id int not null,resource_id int not null,position varchar(20)) default charset=utf8");
echo $rs;
?>